package java56_7;

import java.util.Arrays;
import java.util.Scanner;

public class ArrayCopy {

	public static void main(String[] args) {
		// 定义了一个整数数组，把复制到另一个数组
		int[] ar = new int[8];
		Scanner sc = new Scanner(System.in);
		System.out.printf("请输入%d个数：", ar.length);
		for (int i = 0; i < ar.length; i++) {
			ar[i] = sc.nextInt();
		}
		// int[] ar1 = Arrays.copyOf(ar, ar.length);
		int[] ar1 = new int[ar.length];

		for (int j = 0; j < ar.length; j++) {
			ar1[j] = ar[j];
		}

		Arrays.sort(ar1);
		System.out.println(Arrays.toString(ar));
		System.out.println(Arrays.toString(ar1));

	}

}
